/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jwu2.log;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;

/**
 *
 * @author Rolf
 */
public class StreamLogger implements LoggerI {
    private BufferedWriter writer;

    public StreamLogger(OutputStream os) {
        writer = new BufferedWriter(new OutputStreamWriter(os));
    }
    
    public void log(String msg) {
        try {
            writer.write(msg);
            writer.flush();
        } catch (IOException ex) {
            System.out.println("Error writing to stream: "+ex);
        }
    }
    
    
}
